package org.xi.behavioral.interpreter;

import org.xi.behavioral.interpreter.api.Expression;
import org.xi.behavioral.interpreter.impl.AddExpression;
import org.xi.behavioral.interpreter.impl.SubtractExpression;

public class Main {
    public static void main(String[] args) {
        Expression five = new org.xi.behavioral.interpreter.impl.Number(5);
        Expression three = new org.xi.behavioral.interpreter.impl.Number(3);
        Expression plus = new AddExpression(five, three);
        Expression minus = new SubtractExpression(plus, new org.xi.behavioral.interpreter.impl.Number(2));

        System.out.println("Result: " + minus.interpret()); // 输出: Result: 6
    }
}